@echo off
echo Installing PDF Translation Tool...

:: Download Python
echo Downloading Python 3.10...
powershell -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object Net.WebClient).DownloadFile('https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe', 'python_installer.exe')}"

:: Install Python
echo Installing Python 3.10...
start /wait python_installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
del python_installer.exe

:: Create directories
echo Creating directories...
mkdir uploads 2>nul
mkdir translated 2>nul

:: Install dependencies
echo Installing dependencies...
set PATH=%PATH%;%LOCALAPPDATA%\Programs\Python\Python310\Scripts;%LOCALAPPDATA%\Programs\Python\Python310
python -m pip install --upgrade pip
pip install -r requirements.txt

echo.
echo Installation complete!
echo Please run run.bat to start the application
echo.

pause
